#pragma once
#include "BasePlayer.h"
#include "StateMachine.h"
class Team;

/*
	FieldPlayer.
	A base player with a FSM for his behaviors, it should be part of a team.
*/

class FieldPlayer : public BasePlayer
{

public:
	
	FieldPlayer(GameState* game, Team* team, int homeRegionId, sf::Color drawColor);
	~FieldPlayer();

	void							Update(const sf::Input& input);
	void							OnDraw(sf::RenderWindow&);
	bool							HandleMessage(const Telegram& msg){ return m_FSM->HandleMessage(msg);}

	bool							IsGoalKeeper(){ return false; }
	void							CalculateInterposeWeight();
	void							SetTackled(int x);

	void							ToHome();
	Vector2							FindShot();
	BasePlayer* const				FindPass();
	void							SetUserControl(bool controlled);

	StateMachine<FieldPlayer>*		GetFSM()const{ return m_FSM; }

private:
	StateMachine<FieldPlayer>*		m_FSM;

	bool	CanShootToward(Vector2 toward);

};
